package com.newtouch.bxzs.business.statistics.controller;

import com.newtouch.bxzs.business.config.MyLog;
import com.newtouch.bxzs.business.statistics.model.bo.*;
import com.newtouch.bxzs.business.statistics.model.vo.*;
import com.newtouch.bxzs.business.statistics.service.MemberIssueSumService;
import com.newtouch.bxzs.business.statistics.service.MemberPushSumService;
import com.newtouch.bxzs.business.statistics.service.MemberReceiveSumService;
import com.newtouch.bxzs.business.statistics.service.MemberRecommendationSumService;
import com.newtouch.bxzs.common.base.response.BaseResponse;
import com.newtouch.bxzs.common.base.response.RespGenerator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 成员出单控制器
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021/1/21 13:17</td>
 * <td>lingshouyi</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author lingshouyi
 * @version 1.0.0
 * @since 1.0.0
 */
@Api(tags = "机构意向管理")
@RestController
@RequestMapping("/organizationIntentionController")
@SuppressWarnings("unchecked")
public class OrganizationIntentionController {
    /**
     * 静态变量：系统日志
     */
    private static final Log logger = LogFactory.getLog(OrganizationIntentionController.class);

    @Autowired
    private MemberPushSumService memberPushSumService;

    @Autowired
    private MemberReceiveSumService memberReceiveSumService;

    @Autowired
    private MemberRecommendationSumService memberRecommendationSumService;

    @Autowired
    private MemberIssueSumService memberIssueSumService;

    @ApiOperation(value = "查看成员意向推送汇总")
    @PostMapping("/getMemberPushSumList")
    @MyLog(systemFunctionName = "机构意向管理", systemFunctionUrl = "/organizationIntentionController/getMemberPushSumList", userOperationType = 4, userOperationSummary = "查看成员意向推送汇总")
    public BaseResponse<MemberPushSumBO> getMemberPushSumList(@RequestBody MemberPushSumVO memberPushSumVO) {
        logger.info("查看成员意向推送汇总");
        return RespGenerator.returnOK((memberPushSumService.getMemberPushSumList(memberPushSumVO)));
    }

    @ApiOperation(value = "查看成员意向接收汇总")
    @PostMapping("/getMemberReceiveSumList")
    @MyLog(systemFunctionName = "机构意向管理", systemFunctionUrl = "/organizationIntentionController/getMemberReceiveSumList", userOperationType = 4, userOperationSummary = "查看成员意向接收汇总")
    public BaseResponse<MemberReceiveSumBO> getMemberReceiveSumList(@RequestBody MemberReceiveSumVO memberReceiveSumVO) {
        logger.info("查看成员意向接收汇总");
        return RespGenerator.returnOK((memberReceiveSumService.getMemberReceiveSumList(memberReceiveSumVO)));
    }

    @ApiOperation(value = "查看成员建议书汇总")
    @PostMapping("/getMemberRecommendationSumList")
    @MyLog(systemFunctionName = "机构意向管理", systemFunctionUrl = "/organizationIntentionController/getMemberRecommendationSumList", userOperationType = 4, userOperationSummary = "查看成员建议书汇总")
    public BaseResponse<MemberRecommendationSumBO> getMemberRecommendationSumList(@RequestBody MemberRecommendationSumVO memberReceiveSumVO) {
        logger.info("查看成员建议书汇总");
        return RespGenerator.returnOK((memberRecommendationSumService.getMemberRecommendationSumList(memberReceiveSumVO)));
    }

    @ApiOperation(value = "查看成员出单汇总")
    @PostMapping("/getMemberIssueList")
    @MyLog(systemFunctionName = "机构意向管理", systemFunctionUrl = "/organizationIntentionController/getMemberIssueList", userOperationType = 4, userOperationSummary = "查看成员出单汇总")
    public BaseResponse<MemberIssueSumBO> getMemberIssueList(@RequestBody MemberIssueSumVO memberIssueSumVO) {
        logger.info("查看成员出单汇总");
        return RespGenerator.returnOK((memberIssueSumService.getMemberIssueList(memberIssueSumVO)));
    }

    @ApiOperation(value = "查询机构意向推送汇总")
    @PostMapping("/getOrganizationPushSumList")
    @MyLog(systemFunctionName = "机构意向管理", systemFunctionUrl = "/organizationIntentionController/getOrganizationPushSumList", userOperationType = 4, userOperationSummary = "查询机构意向推送汇总")
    public BaseResponse<OrganizationPushSumBO> getOrganizationPushSumList(@RequestBody OrganizationPushSumVO organizationPushSumVO) {
        logger.info("查询机构意向推送汇总");
        return RespGenerator.returnOK((memberPushSumService.getOrganizationPushSumList(organizationPushSumVO)));
    }

    @ApiOperation(value = "查询机构意向接收汇总")
    @PostMapping("/getOrganizationReceiveSumList")
    @MyLog(systemFunctionName = "机构意向管理", systemFunctionUrl = "/organizationIntentionController/getOrganizationReceiveSumList", userOperationType = 4, userOperationSummary = "查询机构意向接收汇总")
    public BaseResponse<OrganizationReceiveSumBO> getOrganizationReceiveSumList(@RequestBody OrganizationReceiveSumVO organizationReceiveSumVO) {
        logger.info("查询机构意向接收汇总");
        return RespGenerator.returnOK((memberReceiveSumService.getOrganizationReceiveSumList(organizationReceiveSumVO)));
    }

    @ApiOperation(value = "查询机构建议书汇总")
    @PostMapping("/getOrganizationRecommendationSumList")
    @MyLog(systemFunctionName = "机构意向管理", systemFunctionUrl = "/organizationIntentionController/getOrganizationRecommendationSumList", userOperationType = 4, userOperationSummary = "查询机构建议书汇总")
    public BaseResponse<OrganizationRecommendationSumBO> getOrganizationRecommendationSumList(@RequestBody OrganizationRecommendationSumVO organizationRecommendationSumVO) {
        logger.info("查询机构建议书汇总");
        return RespGenerator.returnOK((memberRecommendationSumService.getOrganizationRecommendationSumList(organizationRecommendationSumVO)));
    }

    @ApiOperation(value = "查询机构出单汇总")
    @PostMapping("/getOrganizationIssueSumList")
    @MyLog(systemFunctionName = "机构意向管理", systemFunctionUrl = "/organizationIntentionController/getOrganizationIssueSumList", userOperationType = 4, userOperationSummary = "查询机构出单汇总")
    public BaseResponse<OrganizationIssueSumBO> getOrganizationIssueSumList(@RequestBody OrganizationIssueSumVO organizationIssueSumVO) {
        logger.info("查询机构出单汇总");
        return RespGenerator.returnOK((memberIssueSumService.getOrganizationIssueSumList(organizationIssueSumVO)));
    }
}
